<template>
  <div class="flex">
    <header-page title="flex-滑块"/>
    <ul class="slice">
      <li class="li" v-for="(item, index) in 6" :key="index">{{index}}</li>
    </ul>
  </div>
</template>
<script>
import HeaderPage from './../../components/common/header';

export default {
  components: {
    HeaderPage,
  },
  activated() {
    console.log('flex组件被激活');
  },
  deactivated() {
    console.log('flex组件被停用');
  },
};
</script>

<style lang="less" scoped>
.flex{
  overflow: hidden;
}
.slice{
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  margin: 40px 0;
  overflow: scroll;
  &::after{
    content: '';
    flex-shrink: 0;
    width: 40px;
  }
  .li{
    width: 240px;
    height: 240px;
    color: #fff;
    background: #e0818f;
    flex-shrink: 0;
    margin-left: 40px;
    text-align: center;
    line-height: 240px;
    font-size: 26px;
  }
}
</style>
